package com.hope.mychat.core.bind;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ZWH
 */
public class MyChatObserved implements Observed {

    private List<Observer> observers = new ArrayList<>();

    @Override
    public void registerObserver(Observer o) {
        observers.add(o);
    }

    @Override
    public void removeObserver(Observer o) {
        if (!observers.isEmpty()) {
            observers.remove(o);
        }
    }

    @Override
    public void notifyObserver() {
        for (Observer o : observers) {
            o.onAddChatroomUser("", "");
        }
    }
}
